//
//  PrefectureViewController.h
//  艾听歌
//
//  Created by dllo on 16/5/20.
//  Copyright © 2016年 dllo. All rights reserved.
//


#import "Height.h"

@implementation Height

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

+(CGFloat)getHeightImageWithHeight:(NSNumber *)imageHeight withWidth:(NSNumber *)imageWidth widthNowImage:(CGFloat)widthNowImage{
    
//    UIImage *image = [UIImage imageNamed:myModel.imageStr];
    if ([imageHeight floatValue] == 0) {
        return 0;
    }
    
    CGFloat heightImage = widthNowImage *[imageHeight floatValue] / [imageWidth floatValue];
    
    return heightImage;
}


+(CGFloat)getLabelHeightWithString:(NSString *)myString widthNowLabel:(CGFloat)widthNowLabel fontSize:(CGFloat)fontSize options:(NSStringDrawingOptions)options{
    
    
    if (myString.length == 0) {
        
        return 0;
    }
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:fontSize],NSFontAttributeName, nil];
    
    CGRect rect = [myString boundingRectWithSize:CGSizeMake(widthNowLabel, 0) options:options attributes:dic context:nil];
    
    return rect.size.height;
    
    
}



@end
